package com.ljb.myapplication;

import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

public class MainActivity extends BaseActivity {
    private static final String TAG = "MainActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Intent intent = getIntent();
        if (Intent.ACTION_VIEW.equals(intent.getAction())) {
            Uri data = intent.getData();
            String id = data.getQueryParameter("id");
            Log.e(TAG, "onCreate: id=" + id);
        }

    }

    public void showTest1Activity(View view) {
        Intent intent = new Intent();
        intent.setClass(this, Test1Activity.class);
        startActivity(intent);
    }

    public void showTest2Activity(View view) {
        Intent intent = new Intent();
        intent.setClass(this, Test2Activity.class);
        startActivity(intent);
    }

}
